﻿using System;
using System.Collections.Generic;
using System.Text;

using EShop.Model;
using EShop.DAL;

namespace EShop.BLL
{
    public class Merchandise_BasicInfoBLL
    {

        Merchandise_BasicInfoDAL oMerchandiseBasicInfoDAL = new Merchandise_BasicInfoDAL();

        /// <summary>
        /// 取出所有商品信息数据
        /// </summary>
        /// <returns></returns>
        public List<MerchandiseBasicInfo> GetAllMerchandiseBasicInfo()
        {
            return oMerchandiseBasicInfoDAL.GetAllMerchandiseBasicInfo();
        }

        /// <summary>
        /// 查找相应的商品数据
        /// </summary>
        /// <param name="strSearchValue">商品名称或是商品条码</param>
        /// <param name="iMerchandiseClassID">商品分类</param>
        /// <returns></returns>
        public List<MerchandiseBasicInfo> SearchMerchandiseBasicInfo(string strSearchValue, int iMerchandiseClassID)
        {
            return oMerchandiseBasicInfoDAL.SearchMerchandiseBasicInfo(strSearchValue, iMerchandiseClassID);
        }


        /// <summary>
        /// 添加一条商品信息数据
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool Add(MerchandiseBasicInfo model)
        {
            return oMerchandiseBasicInfoDAL.Add(model);
        }

        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(string strBarCode, MerchandiseBasicInfo model)
        {
            return oMerchandiseBasicInfoDAL.Update(strBarCode,model);
        }

        /// <summary>
        /// 删除一条数据
        /// </summary>
        public bool Delete(string Barcode)
        {
            return oMerchandiseBasicInfoDAL.Delete(Barcode);
        }



    }
}
